<?php
$tel=$_GET['tel'];
$appkey="44409";
$sign="1739ce6e6a7f4f8a20c4a976e0303a70";
$url="http://api.k780.com/?app=phone.get&phone=$tel&appkey=$appkey&sign=$sign&format=json";
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec ($ch);
$data=json_decode($result,true);

$kong=[];
foreach($data as $k=>$v)
{
    $kong=$v;
}

$cheng=$data['result']['att'];
$dbh = new PDO('mysql:host=127.0.0.1;dbname=1705phpa', 'root', 'root');
$sql="insert into tell VALUES (null,'$v[att]','$v[ctype]','$v[operators]','$v[par]','$v[phone]','$v[postno]','$v[prefix]','$v[status]')";
$res=$dbh->exec($sql);
print_r($res);

echo $result;
curl_close ($ch);
return $result;

?>